package com.gw.udf;

import org.apache.hadoop.hive.ql.exec.UDF;

/**
 * @author KingWang
 * @date    2018-11-16
 * @description
 */
public class IndexOf extends UDF{

	public static int evaluate(String str, String split){
		   if(str == null || str == ""
				   || split == null || split == "")
			   return 0;
		   try{  
			   int result = str.indexOf(split);
			   return result;
		   }catch(Exception e){
			   e.printStackTrace();
			   return 0;
		   }
   }
	
	
	public static void main(String[] args) {

	}
 }
